<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>优车处置-账户新增</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <form id="addAcc_form">
        <div class="Hide">
            <input name="bkNm" id="bkNm" type="text" class="ui-textbox" value="">
            <input name="bkCd" id="bkCd" type="text" class="ui-textbox" value="">
        </div>
        <div class="fieldset1 tabel_col tabel_col_1 clearFix">
            <div class="fieldBox col_50">
                <div class="label">收款方<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="rcptUnt" id="rcptUnt" type="text" data-type="text" class="ui-textbox" value=""
                           validate="{required:true,maxlength:100}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">收款账号<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="accNo" id="accNo" type="text" class="ui-textbox" value="" validate="{required:true,maxlength:30}">
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">开户行<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="bankCd" id="bankCd" data-value="" placeholder="请选择" ltype="combobox" validate="{required:true}"/>
                </div>
            </div>
            <div class="fieldBox col_50">
                <div class="label">开户行号<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="bkNo" id="bkNo" type="text" class="ui-textbox" value="" validate="{required:true,maxlength:30}">
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">区域</div>
                <div class="field">
                    <jsp:include page="../../system/sysRegion/region.jsp" flush="true">
                        <jsp:param name="regionShowLvl" value="2"/>
                    </jsp:include>
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">账号类型<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="accTypCd" id="accTypCd" data-value="" placeholder="请选择" ltype="combobox" validate="{required:true}"/>
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">联系方式<span class="requiredSymbol">*</span></div>
                <div class="field">
                    <input name="contTel" id="contTel" type="text" class="ui-textbox" value="" validate="{required:true,maxlength:20}"/>
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">备注</div>
                <div class="field">
                    <input name="bkRem" id="bkRem" type="text" class="ui-textbox" value="" validate="{maxlength:100}">
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">资料上传</div>
                <div class="field">
                    <jsp:include page="../../system/sysUlFilesRec/sysSysUlFilesRecUpload2.jsp" flush="true">
                        <jsp:param name="filePath" value="customer"/>
                    </jsp:include>
                </div>
            </div>
            <div class="fieldBox col_100">
                <div class="label">注</div>
                <div class="field">
                    <span class="requiredSymbol">对公账号需要上传企业营业执照</span>
                </div>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    $(function () {
        $("#addAcc_form").ligerForm({
            validate: true
        });

        $("#bankCd").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            data: ${bankDicList}
        });

        $("#accTypCd").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            data: ${accTypDicList}
        });

        // 点击确认事件
        frameElement.dialog.onOk = function () {
            var ligerForm = liger.get("addAcc_form");
            if (!ligerForm.valid()) {
                top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var uploadParam = JSON.stringify(getUploadResultParams());
            var data = ligerForm.getData();
            data['uploadParam'] = uploadParam;
            data['bkNm'] = liger.get("bankCd").getText();
            var wait_dialog
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: '<%=path%>/capital/finance/loan/apply/bankAcc/add.do',
                beforeSend: function () {
                    wait_dialog = top.$.ligerDialog.SQalert({ content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting" });
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        top.$.ligerDialog.SQalert({
                            content: msg.info, SQ_showButtons: true, SQ_type: "success", onClose: function () {
                                frameElement.dialog.close();
                            }
                        });
                    } else {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        };

        // 解决查看图片被遮盖的问题
        $(".upfileBoxs").on("click", "a.fileIcon", function () {
            // 在iframe子页面获取父页面元素
            $("div.zoomImgWrap", top.frames[top.tab.getSelectedTabItemID()].document).css('z-index', 9999);
        });
    });



</script>

</body>
</html>
